﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Security.Permissions;

namespace Model.Raw_Materials
{
    [Serializable]
    public class Metal : Raw
    {
        public Metal() { }

        protected Metal(SerializationInfo info, StreamingContext context)
            : base(info,context)
        {
            if (info == null)
                throw new System.ArgumentNullException("info");
        }

        public Metal(Ore ore)
            : base(ore.BaseName)
        {
            //base metal quality on ore
            Quality = ore.Quality * 0.8; //some modifier describing how well the metal can be extracted from the ore
            Price = ore.Price * 2; //some modifier describing the cost of extracting the metal
            Quantity = ore.Quantity * 0.5; //some modifier describing the amount of ore converted into bars
        }

        public override String Name
        {
            get { return BaseName + " Bar"; }
        }

        public override string ToString()
        {
            return Name + base.ToString();
        }
    }
}
